package com.sh.data.engine.application.model.request.integration;

import com.sh.data.engine.common.annotation.EnumValue;
import com.sh.data.engine.common.annotation.crypto.EncryptField;
import com.sh.data.engine.common.enumDefinition.DSType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author: mengzheng.mhc
 * @date: 2024/6/13 13:42
 */
@Data
@Schema
public class DataSourceConnectionRequest {

    @Schema(description = "主键")
    private Long id;

    @Schema
    @NotBlank(message = "数据源类型不能为空")
    @EnumValue(enumClass = DSType.class, enumMethod = "isValidDSType", message = "数据源类型值不匹配")
    private String dsType;

    @Schema(description = "jdbc连接", requiredMode = Schema.RequiredMode.REQUIRED)
    private String dsLink;

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "密码")
    @EncryptField
    private String password;
}
